import 'package:json_annotation/json_annotation.dart';

part 'wan_model.g.dart';

@JsonSerializable(genericArgumentFactories: true)
class WanModel<T> {
  final int? errorCode;
  final String? errorMsg;
  final T? data;

  WanModel(this.errorCode, this.errorMsg, this.data);

  factory WanModel.fromJson(
          Map<String, dynamic> srcJson, T Function(Object? json) fromJsonT) =>
      _$WanModelFromJson(srcJson, fromJsonT);

  Map<String, dynamic> toJson(Object? Function(T value) toJsonT) =>
      _$WanModelToJson(this, toJsonT);
}
